﻿using System;
using System.Collections.Generic;
using System.Text;
using X.Entity;
using System.Reflection;

namespace X.DataFactory
{
    public interface IUser
    {
        bool ChangePassword(int userId, byte[] password);
        bool Create(UserInfo user);
        bool Delete(int userId);
        bool Exists(string loginName);
        UserInfo GetUser(int userId);
        UserInfo GetUser(string loginName);
        IList<UserInfo> GetUserList();
        bool Update(UserInfo user);
    }

    public sealed partial class DataAccess
    {
        public static IUser CreateUser()
        {
            string typeName = path + ".User";

            return (IUser)Assembly.Load(path).CreateInstance(typeName);
        }
    }
}
